/* 
 * File:   newfile.h
 * Author: lindenb
 *
 * Created on September 10, 2008, 9:22 AM
 */

#ifndef _ERROR_HEADER
#define	_ERROR_HEADER

#include <stdio.h>

#ifdef	__cplusplus
extern "C" {
#endif

#define ERROR_MAX_MESSAGE_LENGTH 255
    
typedef    struct Error_t
{
    char filename[FILENAME_MAX];
    int nLine;
    int errno;
    char message[ERROR_MAX_MESSAGE_LENGTH];
     struct Error_t *next;
}   Error,*ErrorPtr;

extern ErrorPtr _errorNew(const char* filename,int nLine,ErrorPtr root,int errno,const char* message);
extern void errorDelete(ErrorPtr);
extern void errorPrint(const ErrorPtr,FILE* out);
#define errorNew(root,errno,message) _errorNew(__FILE__,__LINE__,root,errno,message);

#ifdef	__cplusplus
}
#endif

#endif	/* _ERROR_HEADER */

